import Vue from 'vue'
import App from './App.vue'
import Vant from 'vant';
import 'vant/lib/index.css';
import routes from '@/router';
import VueRouter from 'vue-router';
import moment from 'moment';
import Vuex from 'vuex'
import storeConfig from '@/stort'
import '@/assets/styles/main.less'


// 注册全局组件
import NavBar from '@/components/nav-bar';
import ArticleList from '@/components/article-list'

Vue.component('NavBar', NavBar);
Vue.component('ArticleList', ArticleList)

Vue.use(Vuex)

// 全局设置moment语言
moment.locale('zh-cn');

console.log(moment(1658482134742).fromNow()); // 1小时前
// 路由
Vue.use(VueRouter)
Vue.use(Vant);
Vue.config.productionTip = false;

new Vue({
  // 挂载路由
  router: new VueRouter({
    routes,
  }),
  // 挂载store
  store: new Vuex.Store(storeConfig),
  render: h => h(App),
}).$mount('#app')
